<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>S6办公系统</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">
function check(){
	var name =document.getElementById("name").value.toLowerCase();
	if(name==""){
		alert('部门名称不能为空');
		 return false;
		}
		var describe =document.getElementById("describe").value.toLowerCase();
	if(describe==""){
		alert('部门描述不能为空');
		 return false;
		}
 return true;
	}
</script>
  </head>

<body style="background-color:#D6D3C9">
<form action="departmentadd.action" method="post" onsubmit="return check()">
<table width="60%" border="0">
  <tr>
    <td colspan="2" style="text-align:center"><h3>添加部门信息</h3></td>
  </tr>
  <tr>
    <td>部门名称</td>
    <td><input type="text" value="" name="departmentinfo.name" id="name"/></td>
  </tr>
  <tr>
    <td>所属机构</td>
    <td>
     <s:select value="" name="departmentinfo.branchinfo.id" theme="simple" list="list_branchinfo" listKey="id" listValue="name" >
     </s:select>
    </td>
  </tr>
  <tr>
    <td>部门负责人</td>
    <td>
     <s:select value="" name="departmentinfo.userinfo.id" theme="simple" list="list_userinfo" listKey="id" listValue="name">   
      </s:select>
   </td>
  </tr>
  <tr>
    <td>部门描述</td>
    <td><s:textarea name="departmentinfo.describe" id="describe" rows="5" cols="40"></s:textarea></td>
  </tr>

  <tr align="center">
    <td colspan="2"><input type="submit" value="提交"/><input type="button" value="取消" onclick="location.href='javascript:history.back()'"/></td>
  </tr>
</table>
</form>
</body>
</html>